import React, { useEffect } from 'react'
import Mytable from '../../components/Mytable'
import { getShopAduits } from "./../../apis/stores"
import { useState } from 'react';
import { Button, Form, Input,Select} from 'antd';
import Styles from "./../../assets/styles/shoptype.module.less"


const { Option } = Select;

export default function ShopAudits() {
  useEffect(() => {
    fetchData()
  },[])
  const fetchData = async () => {
    const res = await getShopAduits()
    setData(res.data.rows)

  }
  const [data,setData] = useState([])
  const [form] = Form.useForm();
  const columns = [
    {
      title: 'id',
      dataIndex: 'id',
    },
    {
      title: '商铺名称',
      dataIndex: 'shopName',
    },
    {
      title: '手机号码',
      dataIndex: 'tel',
    },
    {
      title: '地址',
      dataIndex: 'address',
    },
    {
      title: '申请人姓名',
      dataIndex: 'managerName',
    },
    {
      title: '身份证号',
      dataIndex: 'idCard',
    },
    {
      title: '审核状态',
      dataIndex: 'status',
    },
    {
      title: '营业执照编号',
      dataIndex: 'licenceNo',
    },
    {
      title: '营业执照',
      dataIndex: 'licenceImg',
      width:80,
      // eslint-disable-next-line no-undef
      render: (record) => <img src={record} alt="" width="50px"/>
    },
    {
      title: '操作',
      width:100,
      render: () => {
        return (
          <>
          <Button>同意</Button>
          <Button>拒绝</Button>
          </>
        )
      }
    },


  ]

  const onFinish = (values) => {
    console.log(values);
  };
  return (
    <div>
      <div className={Styles.headerOne}>
        <Form form={form} name="horizontal_login" layout="inline" onFinish={onFinish}>
          <Form.Item
            name="name"
            label="店铺名称"
          >
            <Input placeholder="" />
          </Form.Item>
          <Form.Item
            name="state"
            label="申请人姓名"
            style={{ width: "300px" }}
          >
            <Input placeholder="" />

          </Form.Item>
          <Form.Item
            name="id"
            label="申请人身份"
            style={{ width: "300px" }}
          >
            <Input placeholder="" />

          </Form.Item>
          <div className={Styles.findOne} style={{marginLeft:100}}>
            <Form.Item shouldUpdate>
              {() => (
                <Button type="primary" htmlType="submit" className={Styles.find}>
                  查询
                </Button>
              )}
            </Form.Item>
            <Button className={Styles.findTwo}>重置</Button>
          </div>

        </Form>
      </div>
      <Mytable columns={columns} data={data}></Mytable>
    </div>
  )
}
